package com.znf4.trade.server.impl;

import java.util.Map;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.znf4.trade.server.TradeManagerServer;
import com.znf4.user.account.entity.UserAccount;
import com.znf4.user.account.server.UserAccountServer;

@Service
public class TradeManagerServerImpl implements TradeManagerServer {
	
	private static final Log log = LogFactory.getLog(TradeManagerServerImpl.class);
	
	@Autowired
	private UserAccountServer userAccountServer ;
	
	
	@Override
	public boolean trade(Map<String, Object> params , UserAccount userAccount ) {
		
		/*//减库存
		if(!goodCommonServer.updateGoodsAmuont(params)){
			log.info("没有抢到该商品");
			return false ;
		} */
			
		//添加减款记录
		userAccountServer.addUserAccount(userAccount) ;
		
		
		/**
		 * 发送到Mq , Mq 接收到之后去创建订单。
		 */
				
		return true ;
	}

}
